package com.home.zqt.platform.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.beetl.sql.core.TailBean;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.Version;

import java.util.Date;

/**
 * @author soon
 */
@Data
public class BaseDomain extends TailBean {

    @AutoID
    private Long id;

    @Version
    @JsonIgnore
    private Long version;

    @JsonIgnore
    private Date whenCreated;

    @JsonIgnore
    private Date whenModified;

    @JsonIgnore
    private String whoCreated;

    @JsonIgnore
    private String whoModified;

//    @SoftDelete
    @JsonIgnore
    private boolean deleted;

    public BaseDomain() {
        this.version = 1L;
        this.whenCreated = new Date();
        this.whenModified = new Date();
        this.whoCreated = "soon";
        this.whoModified = "soon";
        this.deleted = false;
    }
}
